<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BScreenPersonalMessage
 *
 * @author ID59C
 */
class BScreenSpaceMessage extends BUIScreen {

    //put your code here
    //private $divCollection = array();


    public function onRender($data = null) {
        //parent::render($data);
        //$this->addRenderView('ScreenLayout', $this->getLayoutView(), array('uiObj' => $this));
        $this->addRenderView('spaceMessageView', 'spaceMessageView');
        //$this->addRenderView('messageItemView', 'messageItemView2');
        //$this->startRender();
    }

    public function getMessages() {
        $messages = array();
        $ocMessage = new BOCSpaceMessage();
        $opRequests = $ocMessage->getOperationRequests();

        //get operation request of message
        foreach ($opRequests as $opRequest) {
            if ($opRequest->operationName == BOCSpaceMessage::Operation_SendMessage) {
                $opData = $opRequest->data;
                array_push($messages, $opData['message']);
            }
        }

        return $messages;
    }

}

?>
